package org.ccams.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ibatis.common.logging.Log;
import com.ibatis.common.logging.LogFactory;

public abstract class AbstractDao extends SqlMapClientDaoSupport {   
    protected final static Log log = LogFactory.getLog(AbstractDao.class);   
  
    public int updateEntity(Object entity, String statementId)   
            throws Exception {   
        return getSqlMapClientTemplate().update(statementId, entity);   
    }   
  
    public int insertEntity(Object entity, String statementId)   
            throws Exception {   
        return getSqlMapClientTemplate().update(statementId, entity);   
    }   
  
    public int deleteEntity(Object entity, String statementId) throws Exception {   
        return getSqlMapClientTemplate().delete(statementId, entity);   
    }   
  
    public Object queryForObject(Integer pkid, String statementid)   
            throws Exception {   
        return getSqlMapClientTemplate().queryForObject(statementid, pkid);   
    }   
  
    @SuppressWarnings("unchecked")
	public List queryForList(Object params, String statementid)   
            throws Exception {   
        return getSqlMapClientTemplate().queryForList(statementid, params);   
    }   
}  
